/* Copyright 2001,2002,2003 NAH6 BV
 * All Rights Reserved
 *
 *  $Header: /var/lib/cvs/secphone/ui/ce/HideWindow.cpp,v 1.4 2003/11/21 12:39:24 itsme Exp $
 *
 *
 * this modules is used to hide the phoneapp window.
 *
 */
#include <windows.h>
#include "TCHAR.h"

#include "HideWindow.h"

BOOL CALLBACK EnumCloseProc(HWND hwnd, LPARAM lParam)
{
    TCHAR *wintitle= (TCHAR*) lParam;
    TCHAR buf[256];
    GetWindowText(hwnd, buf, 256);

    if (_tcscmp(buf, wintitle)==0)
    {
        ShowWindow(hwnd, SW_HIDE);
        return FALSE;
    }
    return TRUE;
}

void HideWindowByTitle(TCHAR *wintitle)
{
    EnumWindows(EnumCloseProc, (DWORD)wintitle);
}

